<form name="harvesterForm"
      data-ng-keypress="updatingHarvester()">
  <input type="hidden" name="_csrf" value="{{csrf}}"/>

  <div class="row">
    <div id="gn-harvest-settings-selected-id" class="col-lg-6 gn-nopadding-left" data-gn-harvester-identification="harvesterSelected"/>
    <div id="gn-harvest-settings-selected-schedule" class="col-lg-6 gn-nopadding-right" data-gn-harvester-schedule="harvesterSelected"/>
  </div>

  <fieldset id="gn-harvest-settings-wfs-basic-row">
    <legend id="gn-harvest-settings-wfs-basic-title"><span data-translate="">harvesterMainConfigurationFor</span> {{('harvester-' +
      harvesterSelected['@type']) | translate}}
    </legend>

    <div id="gn-harvest-settings-wfs-basic-service-row" data-ng-class="harvesterSelected.site.url == '' ? 'has-error' : ''">
      <label id="gn-harvest-settings-wfs-basic-service-label" class="control-label" data-translate="">serviceUrl</label>
      <input id="gn-harvest-settings-wfs-basic-service-input" type="text" class="form-control" data-ng-model="harvesterSelected.site.url"/>
      <p class="help-block" data-translate="">serviceUrlHelp</p>
    </div>

    <div id="gn-harvest-settings-wfs-basic-query-row">
      <label id="gn-harvest-settings-wfs-basic-query-label" class="control-label" data-translate="">wfsfeatures-query</label>
      <textarea id="gn-harvest-settings-wfs-basic-query-textarea" class="form-control" data-ng-model="harvesterSelected.options.query"/>
    </div>
  </fieldset>

  <fieldset id="gn-harvest-settings-wfs-advanced-row">
    <legend id="gn-harvest-settings-wfs-advanced-title"><span data-translate="">harvesterAdvancedConfigurationFor</span>
      {{harvesterSelected['@type'] | translate}}
    </legend>

    <div id="gn-harvest-settings-wfs-advanced-remote-row" data-gn-harvester-account="harvesterSelected"/>

    <!-- TODO: Could be nicer to have a list of languages -->
    <div id="gn-harvest-settings-wfs-advanced-lang-row">
      <label id="gn-harvest-settings-wfs-advanced-lang-label" class="control-label" data-translate="">wfsfeatures-metadataLanguage</label>
      <input id="gn-harvest-settings-wfs-advanced-lang-input" type="text" class="form-control" data-ng-model="harvesterSelected.options.lang"/>
    </div>

    <div id="gn-harvest-settings-wfs-advanced-schema-row">
      <label id="gn-harvest-settings-wfs-advanced-schema-label" class="control-label" data-translate="">wfsfeatures-outputSchema</label>
      <input id="gn-harvest-settings-wfs-advanced-schema-input" type="text" class="form-control"
             data-ng-model="harvesterSelected.options.outputSchema"/>
    </div>

    <div id="gn-harvest-settings-wfs-advanced-stream-row">
      <label class="control-label">
        <input id="gn-harvest-settings-wfs-advanced-stream-checkbox" type="checkbox" data-ng-model="harvesterSelected.options.streamFeatures"/>
        <span id="gn-harvest-settings-wfs-advanced-stream-label" data-translate="">wfsfeatures-streamFeatures</span>
      </label>
      <p class="help-block" data-translate="">wfsfeatures-streamFeaturesHelp</p>
    </div>

    <div id="gn-harvest-settings-wfs-advanced-style-row">
      <label id="gn-harvest-settings-wfs-advanced-style-label" class="control-label">
        <span data-translate="">wfsfeatures-stylesheet</span>
      </label>
      <select id="gn-harvest-settings-wfs-advanced-style-list" class="form-control" data-ng-model="harvesterSelected.options.stylesheet"
              data-ng-options="s.id as (s.name + ' (' + s.schema + ')') for s in harvesterGetFeatureXSLT"> </select>
      <p class="help-block" data-translate="">wfsfeatures-stylesheetHelp</p>
    </div>

    <div id="gn-harvest-settings-wfs-advanced-category-row" data-gn-category="harvesterSelected.options.recordsCategory" data-lang="{{lang}}"
         data-label="wfsfeature-recordsCategory"/>

    <div id="gn-harvest-settings-wfs-advanced-sub-row">
      <label class="control-label">
        <input id="gn-harvest-settings-wfs-advanced-sub-checkbox" type="checkbox" data-ng-model="harvesterSelected.options.createSubtemplates"/>
        <span id="gn-harvest-settings-wfs-advanced-sub-label" data-translate="">wfsfeatures-createSubtemplates</span>
      </label>
      <p class="help-block" data-translate="">wfsfeatures-createSubtemplatesHelp</p>
    </div>

    <div id="gn-harvest-settings-wfs-advanced-template-row">
      <label id="gn-harvest-settings-wfs-advanced-template-label" class="control-label">
        <span data-translate="">wfsfeatures-templateId</span>
      </label>
      <select id="gn-harvest-settings-wfs-advanced-template-list" class="form-control" data-ng-model="harvesterSelected.options.templateId"
              data-ng-options="t['@id'] as (t.schema + ' > ' + t.title) for t in harvesterTemplates"> </select>
      <p class="help-block" data-translate="">wfsfeatures-templateIdHelp</p>
    </div>

    <div id="gn-harvest-settings-wfs-advanced-subtemplate-row">
      <label id="gn-harvest-settings-wfs-advanced-subtemplate-label" class="control-label" data-translate="">wfsfeature-subtemplateCategory</label>
      <div id="gn-harvest-settings-wfs-advanced-subtemplate-list" data-gn-category="harvesterSelected.categories[0]['@id']" lang="{{lang}}"/>
    </div>

    <div id="gn-harvest-settings-wfs-advanced-validate-row">
      <label id="gn-harvest-settings-wfs-advanced-validate-label" class="control-label">
        <span data-translate="">harvesterValidate</span>
      </label>
      <div id="gn-harvest-settings-wfs-advanced-validate-list" data-gn-harvester-validation="harvesterSelected.content.validate"/>
      <p class="help-block" data-translate="">harvesterValidateHelp</p>
    </div>
  </fieldset>

  <div id="gn-harvest-settings-wfs-privileges-row" data-gn-harvester-privileges="harvesterSelected" data-lang="{{lang}}"/>
</form>
